from decorators import *
import time
@edp_service
class TestService:
    name = "py_calc"
    desc = "a calculator in python"
    category = "test"
    tasks = [
        "list_add_1: List<Int>->List<Int>",
        "int_mul_2: Int->Int"
    ]
    def list_add_1(self, input):
        res = []
        for i in range(len(input)):
            res.append(input[i] + 1)
            time.sleep(1)
            self.update_progress(i / len(input))
            self.log(f"list_add_1: {i} -> {res[i]}")
        return res
    @instant
    def int_mul_2(self, input):
        return input * 2
if __name__ == '__main__':
    TestService.app.run(debug=True, port=5013)


    